home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / pdcurs21.zip / PRIVATE.ZIP / _SETSCRN.C < prev    next >
Text File  |  1992-11-21  |  2KB  |  68 lines

  1. #define        CURSES_LIBRARY  1
  2. #include <curses.h>
  3.  
  4. #ifndef        NDEBUG
  5. char *rcsid__setscrn = "$Header: c:/curses/private/RCS/_setscrn.c%v 2.0 1992/11/15 03:24:37 MH Rel $";
  6. #endif
  7.  
  8.  
  9.  
  10.  
  11. /*man-start*********************************************************************
  12.  
  13.   PDC_set_scrn_mode()  - Set BIOS Video Mode
  14.  
  15.   PDCurses Description:
  16.        Sets the BIOS Video Mode Number ONLY if it is different from
  17.        the current video mode.  This routine is for DOS systems only.
  18.  
  19.   PDCurses Return Value:
  20.        This function returns OK on success and ERR on error.
  21.  
  22.   PDCurses Errors:
  23.        No errors are defined for this function.
  24.  
  25.   Portability:
  26.        PDCurses        int PDC_set_scrn_mode( int new_mode );
  27.  
  28. **man-end**********************************************************************/
  29.  
  30. #ifdef     OS2
  31. int    PDC_set_scrn_mode(VIOMODEINFO new_mode)
  32. #else
  33. int    PDC_set_scrn_mode(int new_mode)
  34. #endif
  35. {
  36. #ifdef FLEXOS
  37.        return( OK );
  38. #endif
  39. #ifdef DOS
  40.        int     cur;
  41.  
  42.        cur = (int) PDC_get_scrn_mode();
  43.        if (cur != new_mode)
  44.        {
  45.                regs.h.ah = 0x00;
  46.                regs.h.al = (char) new_mode;
  47.                int86(0x10, ®s, ®s);
  48.        }
  49.        _cursvar.font = PDC_get_font();
  50.        _cursvar.scrnmode = new_mode;
  51.        LINES = PDC_get_rows();
  52.        COLS = PDC_get_columns();
  53.        return( OK );
  54. #endif
  55. #ifdef OS2
  56.         if (VioSetMode (&new_mode, 0) != 0)
  57.         {
  58.          _cursvar.font = PDC_get_font();
  59.          _cursvar.scrnmode = new_mode;
  60.          LINES = PDC_get_rows();
  61.          COLS = PDC_get_columns();
  62.          return( OK );
  63.         }
  64.        else
  65.          return (ERR);
  66. #endif
  67. }
  68.